Blender Documentation Volume II - Reference Guide: Last modified March 29 2004 S68 | ||
---|---|---|
<<< Previous | Python API Reference | Next >>> |
This module provides access to Material objects in Blender.
Example:
import Blender from Blender import Material mat = Material.New('newMat') # create a new Material called 'newMat' print mat.rgbCol # print its rgb color triplet mat.rgbCol = [0.8, 0.2, 0.2] # change its color mat.setAlpha(0.2) # mat.alpha = 0.2 -- almost transparent mat.emit = 0.7 # equivalent to mat.setEmit(0.8) mat.mode |= Material.Modes.ZTRANSP # turn on Z-Buffer transparency mat.setName('RedBansheeSkin') # change its name mat.setAdd(0.8) # make it glow mat.setMode('Halo') # turn 'Halo' "on" and all others "off" |
Warning: Some Modes are only available when the 'Halo' mode is off and others only when it is on. But these two subsets of modes share the same numerical values in their Blender C #defines. So, for example, if 'Halo' is on, then 'NoMist' is actually interpreted as 'HaloShaded'. We marked all such possibilities in the Modes dict below: each halo-related mode that uses an already taken value is preceded by "-" and appear below the normal mode which also uses that value.
Function Summary | ||
Blender Material or a list of Blender Materials | Get(name) Get the Material object(s) from Blender. | |
Blender Material | New(name) Create a new Material object. |
Get(name=None) Get the Material object(s) from Blender.
|
New(name='Mat') Create a new Material object.
|
Modes The available Material Modes.
|
<<< Previous | Home | Next >>> |
Module Material | Up | Class Material |